//
//  HDidUploadViewController.m
//  NursingManages
//
//  Created by Zhen Huang on 17/6/8.
//  Copyright © 2017年 huangzhen. All rights reserved.
//

#import "HDidUploadViewController.h"
#import "HUploadBaseTableViewCell.h"
#import "InitDbTableQuality.h"
#import "HQc_codeModel.h"
#import "Model_Hr_Ns_Inspect_New.h"
#import "HNightHistoryTableViewCell.h"
@interface HDidUploadViewController ()
<UITableViewDelegate,
UITableViewDataSource>
@property (nonatomic ,strong) UITableView *tableview;
@property (nonatomic ,strong) NSMutableArray *dataArray;
@property (nonatomic ,strong) NSMutableArray *codeArray;
@end

@implementation HDidUploadViewController

- (instancetype)init
{
    if (self) {
        self.dataArray = [NSMutableArray new];
        self.codeArray = [NSMutableArray new];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.tableview];
    InitDbTableQuality *initd = [[InitDbTableQuality alloc]init];
    for (Model_Hr_Ns_Inspect_New *model in self.dataArray) {
        [self.codeArray addObject: [initd GetCodeNameWithCodeID:model.CODE_ID]];
    }
}
- (UITableView *)tableview
{
    if (!_tableview) {
        _tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - NavBarHeight - 50) style:UITableViewStylePlain];
        _tableview.dataSource = self;
        _tableview.delegate = self;
        [_tableview registerClass:[HUploadBaseTableViewCell class] forCellReuseIdentifier:@"cell"];
        _tableview.tableFooterView = [[UIView alloc]init];
    }
    return _tableview;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    HUploadBaseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    Model_Hr_Ns_Inspect_New *model = self.dataArray[indexPath.row];
    HQc_codeModel *codeModel = self.codeArray[indexPath.row];
    cell.code_nameLabel.text = codeModel.CODE_NAME;
    cell.check_dateLabel.text = [NSString stringWithFormat:@"%@",model.CHECK_DATE];
    cell.score_label.text = [NSString stringWithFormat:@"得分:%@",model.SCORE];
    cell.check_nameLabel.text = [NSString stringWithFormat:@"检查者:%@",model.CHECKER_NAME];
    
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
